package com.niodata.dp.task.entity;

import com.niodata.dp.collection.StringList;
import com.niodata.dp.core.OwnerType;
import java.util.Date;

public class PluginPackage {

  private String pkgId;
  private int seqId;
  private String pkgVersion;
  private String pkgName;
  private String pkgType;
  private String pkgLang;
  private String jobType;
  private String creator;
  private String pkgPath;
  private String description;
  private PackageParams params;
  private PackageDefaultParams defaultParams;
  private PackageOutParams outParams;
  private Date createTime;
  private Date updateTime;
  private String developer;
  private String sourceTag;
  private String sourceRepo;
  private boolean publicOn;
  private OwnerType ownerType = OwnerType.GROUP;
  private Long ownerId = new Long(0);
  private PluginSysCategory sysCategory;
  private String funcCategory;
  private String tags = "";
  private PluginStatus status = PluginStatus.Dev;
  private String minPlatformVersion;
  private int taskCount;
  private String scmType = "GitLab";
  private String maintainers;
  private StringList dependencies;
  private String changes;
  private boolean current;
  private boolean failRetry;
  private int downTimes;
  private boolean publicToHub;

  public PluginSysCategory getSysCategory() {
    return sysCategory;
  }

  public void setSysCategory(PluginSysCategory sysCategory) {
    this.sysCategory = sysCategory;
  }

  public String getFuncCategory() {
    return funcCategory;
  }

  public void setFuncCategory(String funcCategory) {
    this.funcCategory = funcCategory;
  }

  public int getSeqId() {
    return seqId;
  }

  public void setSeqId(int seqId) {
    this.seqId = seqId;
  }

  public String getPkgId() {
    return pkgId;
  }

  public void setPkgId(String pkgId) {
    this.pkgId = pkgId;
  }

  public String getDeveloper() {
    return developer;
  }

  public void setDeveloper(String developer) {
    this.developer = developer;
  }

  public String getPkgVersion() {
    return pkgVersion;
  }

  public void setPkgVersion(String pkgVersion) {
    this.pkgVersion = pkgVersion;
  }

  public String getPkgName() {
    return pkgName;
  }

  public void setPkgName(String pkgName) {
    this.pkgName = pkgName;
  }

  public String getPkgType() {
    return pkgType;
  }

  public void setPkgType(String pkgType) {
    this.pkgType = pkgType;
  }

  public String getPkgLang() {
    return pkgLang;
  }

  public void setPkgLang(String pkgLang) {
    this.pkgLang = pkgLang;
  }

  public String getJobType() {
    return jobType;
  }

  public void setJobType(String jobType) {
    this.jobType = jobType;
  }

  public String getCreator() {
    return creator;
  }

  public void setCreator(String creator) {
    this.creator = creator;
  }

  public String getPkgPath() {
    return pkgPath;
  }

  public void setPkgPath(String pkgPath) {
    this.pkgPath = pkgPath;
  }

  public String getDescription() {
    return description;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public PackageParams getParams() {
    return params;
  }

  public void setParams(PackageParams params) {
    this.params = params;
  }

  public PackageDefaultParams getDefaultParams() {
    return defaultParams;
  }

  public void setDefaultParams(PackageDefaultParams defaultParams) {
    this.defaultParams = defaultParams;
  }

  public PackageOutParams getOutParams() {
    return outParams;
  }

  public void setOutParams(PackageOutParams outParams) {
    this.outParams = outParams;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public String getSourceTag() {
    return sourceTag;
  }

  public void setSourceTag(String sourceTag) {
    this.sourceTag = sourceTag;
  }

  public String getSourceRepo() {
    return sourceRepo;
  }

  public void setSourceRepo(String sourceRepo) {
    this.sourceRepo = sourceRepo;
  }

  public OwnerType getOwnerType() {
    return ownerType;
  }

  public void setOwnerType(OwnerType ownerType) {
    this.ownerType = ownerType;
  }

  public Long getOwnerId() {
    return ownerId;
  }

  public void setOwnerId(Long ownerId) {
    this.ownerId = ownerId;
  }

  public String getTags() {
    return tags;
  }

  public void setTags(String tags) {
    this.tags = tags;
  }

  public PluginStatus getStatus() {
    return status;
  }

  public void setStatus(PluginStatus status) {
    this.status = status;
  }

  public boolean isUserSetAbleParam(String name) {
    for (PackageParam param : this.params.getParamSchemas()) {
      if (param.getName().equals(name) && param.isUserSetAble()) {
        return true;
      }
    }
    return false;
  }

  public String getScmType() {
    return scmType;
  }

  public void setScmType(String scmType) {
    this.scmType = scmType;
  }

  public String getMaintainers() {
    return maintainers;
  }

  public void setMaintainers(String maintainers) {
    this.maintainers = maintainers;
  }

  public StringList getDependencies() {
    return dependencies;
  }

  public void setDependencies(StringList dependencies) {
    this.dependencies = dependencies;
  }

  public String getChanges() {
    return changes;
  }

  public void setChanges(String changes) {
    this.changes = changes;
  }

  public int getTaskCount() {
    return taskCount;
  }

  public void setTaskCount(int taskCount) {
    this.taskCount = taskCount;
  }

  public String getMinPlatformVersion() {
    return minPlatformVersion;
  }

  public void setMinPlatformVersion(String minPlatformVersion) {
    this.minPlatformVersion = minPlatformVersion;
  }

  public boolean isCurrent() {
    return current;
  }

  public void setCurrent(boolean current) {
    this.current = current;
  }

  public boolean isPublicOn() {
    return publicOn;
  }

  public void setPublicOn(boolean publicOn) {
    this.publicOn = publicOn;
  }

  public boolean isFailRetry() {
    return failRetry;
  }

  public void setFailRetry(boolean failRetry) {
    this.failRetry = failRetry;
  }

  public int getDownTimes() {
    return downTimes;
  }

  public void setDownTimes(int downTimes) {
    this.downTimes = downTimes;
  }

  public boolean isPublicToHub() {
    return publicToHub;
  }

  public void setPublicToHub(boolean publicToHub) {
    this.publicToHub = publicToHub;
  }

  public Date getUpdateTime() {
    return updateTime;
  }

  public void setUpdateTime(Date updateTime) {
    this.updateTime = updateTime;
  }

  public enum PluginStatus {
    Dev, Deprecated, Release
  }
}

